
CC=gcc
ASM=yasm
ASM32=nasm
C32_FLAGS=-march=athlon-fx -m32 -c -ffreestanding
C_FLAGS=-march=athlon-fx -m64 -c -ffreestanding
ASM_FLAGS=-m amd64 -f elf64
INCLUDE=-I../include
CPP_FLAGS=

OBJECTS=entrance.o kernel.o video.o string.o mm.o mm_list.o pointer.o
OBJECTS32=pre.o mem32.o

kernel: $(OBJECTS32) $(OBJECTS)
	ld -o freeGSD $(OBJECTS32) $(OBJECTS) -Tlink.ld -Map freeGSD.map 

pre.o:
	$(ASM) -f elf32 pre.s -o pre.o
mem32.o:
	$(CC) $(C32_FLAGS) $(INCLUDE) mem32.c -o mem32.o

.c.o:
	$(CC) $(C_FLAGS) $(INCLUDE) $<

.s.o:
	$(ASM) $(ASM_FLAGS) $<

clean:
	rm -f freeGSD*
	rm -f *.o
